import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick .Controls 2.0
Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Button{
        x: 10
        y: 10
        text: "click"
        //槽函数{}
        onClicked: {
            console.log(add(10,20))
        }
        //定义一个相加函数
        function add(num1,num2){
            return num1+num2
        }
    }
}
